package br.net.woodstock.tickettoride.client;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public final class TicketClientProperties {

	private static TicketClientProperties	instance	= new TicketClientProperties();

	private static final String				CONFIG_FILE	= "tickettoride-client.properties";

	private Properties						properties;

	private TicketClientProperties() {
		super();
		try {
			InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(TicketClientProperties.CONFIG_FILE);
			this.properties = new Properties();
			this.properties.load(inputStream);
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	public String getProperty(final String key) {
		return this.properties.getProperty(key);
	}

	public static TicketClientProperties getInstance() {
		return instance;
	}

}
